-
Notifications
You must be signed in to change notification settings - Fork 25.6k
add copy_from parameter for set ingest processor #63540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Would it be possible to modify the |
|
@danhermann, the usage of |
Thanks, @gaobinlong. Your explanation makes sense and we'd like to move forward with the |
|
@elasticmachine update branch |
|
@elasticmachine ok to test |
danhermann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gaobinlong, from my testing, this looks good and works well. I left some minor wording changes below as well as a request to split up one of the unit tests. I think we can get it merged after that.
modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/SetProcessor.java
Outdated
Show resolved
Hide resolved
...es/ingest-common/src/test/java/org/elasticsearch/ingest/common/SetProcessorFactoryTests.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Dan Hermann <[email protected]>
Co-authored-by: Dan Hermann <[email protected]>
…ommon/SetProcessor.java Co-authored-by: Dan Hermann <[email protected]>
|
@elasticmachine test this please. |
|
Thanks, @gaobinlong. This looks good. The last failing test is due to the fact that line 120 in |
|
@elasticmachine update branch |
|
Thanks again for this contribution, @gaobinlong! I'll get it merged and backported. |
|
Pinging @elastic/es-core-features (:Core/Features/Ingest) |
Relates to #55682 and #51046, and refractor the code of #56985.
The main point of this PR is adding a
copy_fromparameter for set ingest processor to supportcopythe value of one field to another. We can copyboolean,number,array,objectand other data types by the parametercopy_frominstead of usingtemplate snippetwhich only producesstringvalue.Why adding a new parameter to implement the
copyfunction but not modifying thetemplate snippetso that it can produceobjectorarrayvalue ? I think we can make it compatible with older versions, users can still usetemplate snippetto copy the producedstringvalue to other field, but also can usecopy_fromto copyobjectorarrayvalue from one field to another.The main changes are:
copy_fromparameter for set ingest processor.